<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            display: flex;
            width: 700px;
            height: 300px;
            border-left: 1px solid pink;
            margin: 50px auto;
            justify-content: space-around;
            align-items: flex-end;
            text-align: center;
            border-bottom: 1px solid pink;

        }

        .box>div {
            /* x相当于div是父盒子 开启flex布局 */
            display: flex;
            width: 50px;
            background-color: pink;
            border: 1px solid black;
            flex-direction: column;
            justify-content: space-between;
        }

        /* 这个很特殊 不太会 */
        .box div span {
            margin-top: -20px;
        }

        .box div h4 {
            margin-bottom: -35px;
            width: 70px;
            margin-left: -10px;
        }
    </style>
</head>

<body>


    <script>
        let arr = []
        for (let i = 1; i <= 4; i++) {
            let num = prompt(`输入第${i}个数`)
            arr.push(num)
        }
        console.log(arr);


        //盒子开头
        document.write(` <div class="box">`)
        for (let i = 0; i < arr.length; i++) {
            document.write(`
                <div style="height:${arr[i]}px">
                <span>${arr[i]}</span>
                <h4>${i + 1}</h4>
                </div>`)
        }
        document.write(` </div> `)

            //盒子结尾
    </script>
    </div>
</body>

</html>